#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>

int count1 = 0;//大写字母
int count2 = 0;//小写字母
int count3 = 0;//数字
int count4 = 0;//空格
int count5 = 0;//其他字符

void sta(char x[]);//函数声明

int main()
{
	char arr[80] = {'0'};
	printf("please input string:\n");
	gets(arr);
	printf("The string is :");
	printf("%s\n", arr);
	sta(arr);
	printf("\n大写字母的个数为：%d\n", count1);
	printf("小写字母的个数为：%d\n", count2);
	printf("数字的个数为：%d\n", count3);
	printf("空格的个数为：%d\n", count4);
	printf("其他字符的个数为：%d\n", count5);
	return 0;
}
void sta(char x[])
{
	int i = 0;
	for (i = 0;i<80 && x[i] != '\0'; i++)
	{
		if (x[i] >= 'A' && x[i] <= 'Z')
		{
			count1++;	
		}
		else if (x[i] >= 'a' && x[i] <= 'z')
		{
			count2++;
		}
		else if (x[i] >= '0' && x[i] >= '9')
		{
			count3++;
		}
		else if (x[i] == ' ')
		{
			count4++;
		}
		else
		{
			count5++;
		}
	}
}